package com.fristvue.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.fristvue.dao.GoodsDao;
import com.fristvue.po.Goods;
import com.fristvue.po.Util.Page;
import com.fristvue.po.Util.Utils;
import com.fristvue.service.GoodsService;

@Service
@Transactional
public class GoodsServiceImpl implements GoodsService {
	@Autowired
	private GoodsDao goodsDao;

	@Override
	public boolean deleteByPrimaryKey(Integer goodsId) {
		// TODO Auto-generated method stub
		return this.goodsDao.deleteByPrimaryKey(goodsId);
	}

	@Override
	public Goods selectByPrimaryKey(Integer goodsId) {
		// TODO Auto-generated method stub
		return this.goodsDao.selectByPrimaryKey(goodsId);
	}

	@Override
	public Page<Goods> AllGoodsLimit(Integer num, Integer size, Utils goods) {
		// TODO Auto-generated method stub
		Page<Goods> goodsPage = new Page<Goods>();
		goodsPage.setList(this.goodsDao.AllGoodsLimit(num, size, goods));
		goodsPage.setNum(this.goodsDao.AllGoodsSize(goods));
		return goodsPage;
	}

	@Override
	public int updateByPrimaryKeySelective(Goods record) {
		// TODO Auto-generated method stub
		return this.goodsDao.updateByPrimaryKeySelective(record);
	}

	@Override
	public boolean addGoods(Goods goods) {
		// TODO Auto-generated method stub
		return this.goodsDao.addGoods(goods);
	}

	@Override
	public List<Goods> whereGoods() {
		// TODO Auto-generated method stub
		return this.goodsDao.whereGoods();
	}

}
